<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background: #000;
        }
    </style>
</head>
<body>
<div>
    <button onclick="width()">变宽</button>
    <button onclick="height()">变高</button>
    <button onclick="color()">变色</button>
    <button onclick="hidd()">消失</button>
    <button onclick="restore()">重置</button>
</div>
<div class="box">

</div>
<script>
    var box = document.getElementsByClassName("box")[0]

    function width() {
        box.style.width = "300px";
    }

    function height() {
        box.style.height = "300px";
        box.style.width = "200px";
    }
    function color() {
        box.style.background="red"
    }

    function hidd() {
        box.style.display = "none";
    }

    function restore() {
        // box.style.display="block";
        // box.style.height="100px";
        // box.style.width="200px";
        // box.style.background="#000"
        box.style = ({
            display: "block",
            height: "100px",
            width: "200px",
            background: "#000",
        })

    }
</script>
</body>
</html>